/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

/**
 * 订单退款
 *  */
// eslint-disable-next-line import/no-extraneous-dependencies
import { Request, Response } from 'express';
import { responseSuccess } from '../utils';
import Mock from 'mockjs';

export default {
  'POST /RefundApply/index': (req: Request, res: Response) => {
    const data = Mock.mock({
      'list|1-300': [
        {
          'id|+1': 1,
          'order_id|+1': 705265247805000,
          'status|1': ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '-20'], //订单状态
          'channel|1': ['mina', 'minpost', 'yz'], //订单渠道
          shipper_name: '@cname(2, 5)', //发件人姓名
          shipper_mobile: '137' + Mock.mock(/\d{8}/), //手机号码
          'freight|1-100': 100, //支付金额
          'pay_status|1': [0, 1, 2, 3, 4, 5], //支付状态
          'handle_status|1': [0, 1, 2, 3, 4, 5], //处理状态
          'handle_message|1': ['快递员', '退款失败', '申请客服处理'], //处理进度
          apply_time: '@now()', //退款申请时间
          pay_time: '@now()', //退款申请时间
        },
      ],
    });
    return res.json({
      code: 0,
      data: {
        ...data,
        count: data.list.length,
      },
      msg: 'success',
    });
  },
  'POST /RefundApply/refund': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /RefundApply/refundMoneyAndStatus': (req: Request, res: Response) =>
    responseSuccess(req, res),
  'POST /RefundApply/refundAvailMoney': (req: Request, res: Response) => responseSuccess(req, res),
};
